﻿//特殊折佣
Chenxin.UI.Discount = Chenxin.extend(Chenxin.UI.FormCommon, {
    actionUrl: '/service/logic/ShowListBargain.ashx',
    id: 'jqdiscount',
    renderTo: 'div_discount',
    winCls: '',
    jqmWidth: 700,
    defBBtn: true,
    scope: this,
    op: 'discount',
    createForm: function() {
        return Chenxin.FormCommon.Discount(this.id);
    },
    initFormValidator: function() {
        //上家折让
        $("#VSTDiscount").formValidator({
            validatorgroup: this.id,
            onshow: "请输入上家折让！",
            onfocus: "请输入上家折让！",
            oncorrect: " "
        }).inputValidator({
            min: 1,
            empty: {
                leftempty: false,
                rightempty: false,
                emptyerror: "不能为空！"
            },
            onerror: "不能为空！"
        }).functionValidator({ //数字验证
            fun: function(val, elem) {
                val = Chenxin.Fn.fullToHalfChar(val);
                if (parseInt(val) < 0) {
                    return false;
                }
                else {
                    return val.isNum();
                }
            },
            onerror: "请输入非0数字"
        });
        //下家折让
        $("#BSTDiscount").formValidator({
            validatorgroup: this.id,
            onshow: "请输入下家折让！",
            onfocus: "请输入下家折让！",
            oncorrect: " "
        }).inputValidator({
            min: 1,
            empty: {
                leftempty: false,
                rightempty: false,
                emptyerror: "不能为空！"
            },
            onerror: "不能为空！"
        }).functionValidator({ //数字验证
            fun: function(val, elem) {
                val = Chenxin.Fn.fullToHalfChar(val);
                if (parseInt(val) <0) {
                    return false;
                }
                else {
                    return val.isNum();
                }
            },
            onerror: "请输入非0数字"
        });
    },
    saveSucc: function() {
        this.reloadGrid();
    },
    initComponent: function() {
        Chenxin.UI.Discount.superclass.initComponent.call(this);
    }
});

Chenxin.FormCommon.Discount = function(formID) {
return '<table style="width:100%;margin:5px 0px;"><tbody><tr style="line-height: 26px;"><th style="width:120px;text-align:right;">成交编号：</th><td><input style="width:120px;" name="ContractCode" class="inputbox_n fl" id="ContractCode" type="text" readonly="readonly" /></td><th style="text-align:right;">房源地址：</th><td colspan="3"><input style="width:325px;" name="HouseAddress" class="inputbox_n fl" id="Address" type="text" readonly="readonly"/></td><tr style="line-height: 26px;"><th style="text-align:right;">上家确认佣收：</th><td><input style="width:120px;" name="VRealCommision" class="inputbox_n fl" type="text" readonly="readonly"/></td><th style="text-align:right;">上家折佣：</th><td><input style="width:120px;" name="VCommision" class="inputbox_n fl" type="text" readonly="readonly"/></td><th style="text-align:right;">上家咨询费：</th><td><input style="width:120px;" name="VConsulting" class="inputbox_n fl" type="text" readonly="readonly"/></td></tr><tr style="line-height: 26px;"><th style="width:80px;text-align:right;">下家确认佣收：</th><td><input style="width:120px;" name="BRealCommision" class="inputbox_n fl" type="text" readonly="readonly"/></td><th style="text-align:right;">下家折佣：</th><td><input style="width:120px;" name="BCommision" class="inputbox_n fl" type="text" readonly="readonly"/></td><th style="text-align:right;">下家咨询费：</th><td><input style="width:120px;" name="BConsulting" class="inputbox_n fl" type="text" readonly="readonly"/></td></tr></tr><tr style="line-height: 26px;"><th style="text-align:right;"><span class="isfilled">*</span>上家折让：</th><td colspan="5"><input style="width:120px;" name="VSTDiscount" id="VSTDiscount" class="inputbox_n fl" type="text" /><div id="VSTDiscountTip" style="float: left; margin-left: 5px; width: 121px; height: 26px; line-height: 26px; text-align: left;" class="fl"></div></td></tr><tr><th style="text-align:right;"><span class="isfilled">*</span>下家折让：</th><td colspan="5"><input style="width:120px;" name="BSTDiscount" id="BSTDiscount" class="inputbox_n fl" type="text" /><div id="BSTDiscountTip" style="float: left; margin-left: 5px; width: 121px; height: 26px; line-height: 26px; text-align: left;" class="fl"></div></td></tr><tr><th style="text-align:right;">折让理由：</th><td colspan="5"><textarea id="RemarkInfo" name="STMemo" class="textarea_n" cols="80" rows="10" class="textarea_n" style=" float:left; width: 500px; height: 60px; padding:5px;" /><input type="hidden"  name="ContractId" /></td></tr><tr></tr></tbody></table>';
};